<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>选项卡</title>
        <style>
            *{
                margin: 0px;
                padding: 0px;
                list-style: none;
            }
            ul{
                overflow: hidden;
                margin: -129px 0px 12px 450px;
                position: relative;
                left: -77px;
                top: 169px;
            }
             li{
                width: 120px;
                text-align: center;
                height: 50px;
                line-height: 50px;
                cursor: pointer;
                border: 1px solid black;
            }
            img{
                margin-top: 20px;
            }
            div{
                width: 300px;
                height: 590px;
                margin: 0px auto;
                border:3px solid #0e19bb;
                border-radius: 5px;
                display: none;
            }
            p{
                font-size: 30px;
                cursor: pointer;
            }
             li.current{
                background:aqua;
                color:white;
            }
            div.current{
                display: block;
            }
        </style>
    </head>
    <body>
        <ul>
            <li class="current">华语歌手</li>
            <li>欧美歌手</li>
            <li>日本歌手</li>
        </ul>
        <section>
            <div class="current">
                
                        <img src="images/hua1.jpg" alt="">
                        <p>林俊杰</p>
                   
                        <img src="images/hua2.jpg" alt="">
                        <p>薛之谦</p>
                    
                        <img src="images/hua3.jpg" alt="">
                        <p>陈奕迅</p>
                    
               
            </div>
            <div>
                <img src="images/ou1.jpg" alt="">
                        <p>Justin Bieber</p>
                   
                        <img src="images/ou2.jpg" alt="">
                        <p>Troye Sivan</p>
                    
                        <img src="images/ou3.jpg" alt="">
                        <p>Taylor Swift</p>
            </div>
            <div>
                <img src="images/ri1.jpg" alt="">
                        <p>米津玄师</p>
                   
                        <img src="images/ri2.jpg" alt="">
                        <p>久石让</p>
                    
                        <img src="images/ri3.jpg" alt="">
                        <p>坂本龙一</p>
            </div>
        </section>

        <script>
            var tags=document.getElementsByTagName('li');
            var boxs=document.getElementsByTagName('div');
            for(var i=0;i<tags.length;i++){
                tags[i].index=i;
                tags[i].onclick=function(){
                    for(var j=0;j<tags.length;j++){
                        tags[j].className=''
                        boxs[j].className=''
                    }
                    this.className='current';
                    var n=this.index;
                    boxs[n].className='current'
                }
            }
        </script>
    </body>
</html>